'use client';

interface LoadingProps {
  size?: 'small' | 'default' | 'large';
  tip?: string;
  className?: string;
}

const Loading: React.FC<LoadingProps> = ({ 
  size = 'default', 
  tip = '加载中...', 
  className = '' 
}) => {
  // 根据size确定动画大小
  const sizeClasses = {
    small: 'w-6 h-6 border-2',
    default: 'w-8 h-8 border-3',
    large: 'w-12 h-12 border-4'
  };

  return (
    <div className={`flex flex-col justify-center items-center h-full ${className}`}>
      <div className={`animate-spin rounded-full border-current border-t-transparent text-cyan-500 ${sizeClasses[size]}`}></div>
      {tip && <p className="mt-2 text-sm text-gray-500">{tip}</p>}
    </div>
  );
};

export default Loading;
